#ifndef ASPECT_H
#define ASPECT_H

#include "sgeTypes.h"

namespace sge {

    class Object;
    class Aspect;
    class VarDict;
    
    typedef std::map<String,Aspect*> StringAspectPtrMap;
    typedef std::list<Aspect*> AspectPtrList;
    
    class Aspect {
    protected:
        Object* object;
        String name, type, family;
        
        bool initialized, active, destroyed;
    
    public:
        Aspect(const String& _name, const String& _type, const String& _family, Object* _object);
        
        bool preInit();
        bool preUpdate(float time, float dtime);
        bool preDestroy();
        
        bool getActive() const;
        void setActive(bool _active);
        
        void log(const char* format, ...);
        
        virtual void init() {}
        virtual void update(float time, float dtime) {}
        virtual void destroy() {}
        
        virtual void onSetVar(const String& varName) {}
        virtual void onGetVar(const String& varName) {}
        
        virtual void receiveMessage(const String& cmd, const VarDict& args) {}
    };

}

#include "object.h"

#endif
